- fixed PHPDoc
- replaced deprecated function
Bug: T153252
Change-Id: I072a1c1201bd19eafe7c50bbbf32a71fa4a92a46
* Revision::FOR_PUBLIC to be displayed to all users
* Revision::FOR_THIS_USER to be displayed to the given user
* Revision::RAW get the ID regardless of permissions
* Revision::FOR_PUBLIC to be displayed to all users
* Revision::FOR_THIS_USER to be displayed to the given user
* Revision::RAW get the ID regardless of permissions
- * @param User $user User object to check for, only if FOR_THIS_USER is passed
+ * @param User|null $user User object to check for, only if FOR_THIS_USER is passed
* to the $audience parameter
* @return int
*/
* to the $audience parameter
* @return int
*/
* Revision::FOR_PUBLIC to be displayed to all users
* Revision::FOR_THIS_USER to be displayed to the given user
* Revision::RAW get the text regardless of permissions
* Revision::FOR_PUBLIC to be displayed to all users
* Revision::FOR_THIS_USER to be displayed to the given user
* Revision::RAW get the text regardless of permissions
- * @param User $user User object to check for, only if FOR_THIS_USER is passed
+ * @param User|null $user User object to check for, only if FOR_THIS_USER is passed
* to the $audience parameter
* @return string
*/
* to the $audience parameter
* @return string
*/
* Revision::FOR_PUBLIC to be displayed to all users
* Revision::FOR_THIS_USER to be displayed to the given user
* Revision::RAW get the text regardless of permissions
* Revision::FOR_PUBLIC to be displayed to all users
* Revision::FOR_THIS_USER to be displayed to the given user
* Revision::RAW get the text regardless of permissions
- * @param User $user User object to check for, only if FOR_THIS_USER is passed
+ * @param User|null $user User object to check for, only if FOR_THIS_USER is passed
* to the $audience parameter
* @return string
*/
* to the $audience parameter
* @return string
*/
* @param File $image File associated with this thumbnail
* @param array $params Array with scaler params
*
* @param File $image File associated with this thumbnail
* @param array $params Array with scaler params
*
- * @return MediaTransformError Error object if error occurred, false (=no error) otherwise
+ * @return MediaTransformError|bool Error object if error occurred, false (=no error) otherwise
*/
protected function transformImageMagick( $image, $params ) {
# use ImageMagick
*/
protected function transformImageMagick( $image, $params ) {
# use ImageMagick
* @param File $image File associated with this thumbnail
* @param array $params Array with scaler params
*
* @param File $image File associated with this thumbnail
* @param array $params Array with scaler params
*
- * @return MediaTransformError Error object if error occurred, false (=no error) otherwise
+ * @return MediaTransformError Error|bool object if error occurred, false (=no error) otherwise
*/
protected function transformImageMagickExt( $image, $params ) {
global $wgSharpenReductionThreshold, $wgSharpenParameter, $wgMaxAnimatedGifArea,
*/
protected function transformImageMagickExt( $image, $params ) {
global $wgSharpenReductionThreshold, $wgSharpenParameter, $wgMaxAnimatedGifArea,
* @param File $image File associated with this thumbnail
* @param array $params Array with scaler params
*
* @param File $image File associated with this thumbnail
* @param array $params Array with scaler params
*
- * @return MediaTransformError Error object if error occurred, false (=no error) otherwise
+ * @return MediaTransformError Error|bool object if error occurred, false (=no error) otherwise
*/
protected function transformCustom( $image, $params ) {
# Use a custom convert command
*/
protected function transformCustom( $image, $params ) {
# Use a custom convert command
* @param File $image File associated with this thumbnail
* @param array $params Array with scaler params
*
* @param File $image File associated with this thumbnail
* @param array $params Array with scaler params
*
- * @return MediaTransformError Error object if error occurred, false (=no error) otherwise
+ * @return MediaTransformError|bool Error object if error occurred, false (=no error) otherwise
*/
protected function transformGd( $image, $params ) {
# Use PHP's builtin GD library functions.
*/
protected function transformGd( $image, $params ) {
# Use PHP's builtin GD library functions.
if ( is_int( $from ) ) {
list( $index, $opts ) = DBAccessObjectUtils::getDBOptions( $from );
$data = $this->pageDataFromTitle( wfGetDB( $index ), $this->mTitle, $opts );
if ( is_int( $from ) ) {
list( $index, $opts ) = DBAccessObjectUtils::getDBOptions( $from );
$data = $this->pageDataFromTitle( wfGetDB( $index ), $this->mTitle, $opts );
+ $loadBalancer = MediaWikiServices::getInstance()->getDBLoadBalancer();
if ( !$data
&& $index == DB_REPLICA
if ( !$data
&& $index == DB_REPLICA
- && wfGetLB()->getServerCount() > 1
- && wfGetLB()->hasOrMadeRecentMasterChanges()
+ && $loadBalancer->getServerCount() > 1
+ && $loadBalancer->hasOrMadeRecentMasterChanges()
) {
$from = self::READ_LATEST;
list( $index, $opts ) = DBAccessObjectUtils::getDBOptions( $from );
) {
$from = self::READ_LATEST;
list( $index, $opts ) = DBAccessObjectUtils::getDBOptions( $from );